// 导入express
var express = require('express')
  // 启动express
var app = express();

// 解决跨域问题
app.all('*', function(req, res, next) {
  res.header("Access-Control-Allow-Origin", "*");
  res.header("Access-Control-Allow-Headers", "X-Requested-With");
  res.header("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OPTIONS");
  res.header("X-Powered-By", '3.2.1');
  res.header("Content-Type", "application/json;charset=utf-8");
  next();
})

app.get('/navlist', function(req, res) {
  var navlist = [
    "推荐",
    "居家生活",
    "服饰鞋包",
    "美食酒水",
    "个护清洁",
    "母婴亲子",
    "运动旅游",
    "数码家电",
    "严选全球",
  ]
  res.send(navlist);
})

// 监听
app.listen(5632, function() {
  console.log('端口号为5632,网易严选中间件，已经运行');
})